<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of customSQL
 *
 * @author hodek
 */
class SQLImp extends SQLAbstract {
    //put your code here
    
    public static $SELECT_BLOG_SORTED = "SELECT DISTINCT a.itemid, number.data as visibility, date.data as date FROM (SELECT DISTINCT itemid FROM itemmap WHERE itemmap.itemtype_name = 'blog' ) as a LEFT JOIN (SELECT value_name, itemmap.itemid as dateid FROM itemmap WHERE itemmap.item_name = 'datumClanku') as b ON (dateid = a.itemid) LEFT JOIN (SELECT value_name, itemmap.itemid as visibilityid FROM itemmap WHERE itemmap.item_name = 'VISIBILITY') as c ON (visibilityid = a.itemid) LEFT JOIN number ON (c.value_name = number.name) LEFT JOIN date ON (b.value_name = date.name) ORDER BY date DESC";
    public static $SELECT_GAMES_SORTED = "SELECT DISTINCT a.itemid, number.data as visibility, date.data as date FROM (SELECT DISTINCT itemid FROM itemmap WHERE itemmap.itemtype_name = 'games' ) as a LEFT JOIN (SELECT value_name, itemmap.itemid as dateid FROM itemmap WHERE itemmap.item_name = 'datumClanku') as b ON (dateid = a.itemid) LEFT JOIN (SELECT value_name, itemmap.itemid as visibilityid FROM itemmap WHERE itemmap.item_name = 'VISIBILITY') as c ON (visibilityid = a.itemid) LEFT JOIN number ON (c.value_name = number.name) LEFT JOIN date ON (b.value_name = date.name) ORDER BY date DESC";
}

?>
